package com.macro.mall.sms.service.impl;

import com.macro.mall.sms.config.BeanConfig;
import com.macro.mall.sms.config.SmsServiceFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 中心控制类
 * @author zhouboyu
 * @Date 2020年8月25日
 */
@Service
public class DoSend {
    @Autowired
    private BeanConfig beanConfig;
    @Autowired
    private SmsServiceFactory smsServiceFactory;

    public String doSend(String mobile, String templateCode, Map<String,String> params) {
        return this.smsServiceFactory.getInstance(this.beanConfig).send(mobile,templateCode,params);
    }
}
